Skip to content

Share offline validation between job validate and job submit commands#8068

Merged
saanikaguptamicrosoft merged 4 commits into
Azure:foundry-training-devfrom
saanikaguptamicrosoft:saanika/validate2
May 6, 2026
Merged

Share offline validation between job validate and job submit commands#8068
saanikaguptamicrosoft merged 4 commits into
Azure:foundry-training-devfrom
saanikaguptamicrosoft:saanika/validate2

Conversation

@saanikaguptamicrosoft
Copy link
Copy Markdown
Collaborator

@saanikaguptamicrosoft saanikaguptamicrosoft commented May 6, 2026

Notes

  1. Refer validation PR: Add validate command for custom training #7407 (some of the warning severity validations have been converted to error severity based on API response)
  2. On top of that we also added validations which were missing in AML as an enhancement in user experience-
    • default is a reserved name for outputs (backend fails immediately)
    • ssh public keys should be present (the job fails later on and customer can't ssh without keys)
    • Input/Output type is required, else backend throws immediate error on submit
  3. Refactored offline validation into a shared utils.ValidateJobOffline + utils.ReportValidationResult so submit runs the same checks as validate up-front, before any upload/network work.

Testing

Happy Path
image

Unhappy paths
image

Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean refactoring - the shared validation path is straightforward and the new checks (reserved "default" output name, services validation) are well-tested.

One thing to clean up: job_submit.go still has two comments referencing the now-removed ValidateJobDefinition:

  • Line ~164: // Services (e.g., SSH). Validation in ValidateJobDefinition restricts type to "ssh"
  • Line ~173: // Currently only SSH is supported (enforced by ValidateJobDefinition).

These should say ValidateJobOffline instead.

Also, the PR description (Notes/Testing sections) is empty - might be worth filling in for reviewer context.

@saanikaguptamicrosoft saanikaguptamicrosoft merged commit cefaacb into Azure:foundry-training-dev May 6, 2026
1 of 2 checks passed
Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses my earlier comment - stale references updated. The new input/output type-required validations look correct: path-style inputs (no value:) must declare a type, and all outputs must too. Test coverage is solid (positive + negative cases for both). Nothing else to flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants